import java.io.PrintStream;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;

public class Roster extends UserInterface{

	public HashMap<Integer, Player> jerseyMap = new HashMap<Integer, Player>();
	//maps jersey number to player name


	public void addPlayer( int jerseyNum, Player name) {
		jerseyMap.put(jerseyNum,name);
	}


	public Player getPlayer(int nex) {
		return this.jerseyMap.get(jerseyNum);
	}

	public void removePlayer( int jerseyNum, Player name){
		jerseyMap.remove(jerseyNum);
	}

	public void getAllPlayer(String playerName, int jerseyNum, int height, int weight, int yob, String college, 
			String position){
		Iterator<Integer> iterator = jerseyMap.keySet().iterator();
		//Set<Integer> set = jerseyMap.keySet();
		//Iterator<Integer> iterator = set.iterator();
		//Iterator iterator = jerseyMap.keySet().iterator();
		System.out.println("");
		System.out.println("Below shows that the players are getting added to the hashmap,\nbut we could not get our print statement to access all the player objects");
		System.out.println("");
		System.out.println(jerseyMap);
		System.out.println("");
		System.out.printf("\t\t\t\t%s Roster\n", getTeamName());
		System.out.printf("Player's name \t JerseyNumber\t Height\t Weight\t YearOfBirth\t College\t Postition\t\n");

		//for(jerseyMap.keySet().iterator();iterator.hasNext();){
		//iterator.hasNext();
		//jerseyMap.get(iterator.next());}
		
	
		while(iterator.hasNext()){
			int nex = iterator.next();
			//System.out.print(nex);
			System.out.print("");
			//System.out.printf("%s\n", jerseyMap.get(nex).getSize());
			//System.out.println(iterator.next());

			System.out.printf("%s\t %d\t\t %d\t %d\t %d\t\t %s\t\t %s\t\t\n", jerseyMap.get(nex).getPlayerName(),  jerseyMap.get(nex).getJerseyNum(), jerseyMap.get(nex).getHeight(), jerseyMap.get(nex).getWeight(),
					jerseyMap.get(nex).getYob(), jerseyMap.get(nex).getCollege(), jerseyMap.get(nex).getPosition());
		}
		
		//EXPERIMENTAL CODE TO TRY AND GET THE PRINT STATEMENT TO WORK IS BELOW
		
		/*final int size; 
		size = jerseyMap.size();
		Iterator iterator = jerseyMap.keySet().iterator();

		//for(jerseyMap.keySet().iterator();iterator.hasNext();){
//		iterator.hasNext();
        System.out.printf("Player's name \t JerseyNumber\t Height\t Weight\t YearOfBirth\t College\t Postition\t\n");
		for(int x = 0; x<size;x++){


			 jerseyMap.get(iterator.next());
			 jerseyMap.values();

			//System.out.println(iterator);


		 System.out.printf("%s\t\t %d\t %d\t %d\t %d\t\t %s\t\t %s\t\n",getPlayerName(), getJerseyNum(), getHeight(), getWeight(), 
				getYob(), getCollege(), getPosition());
			 }



		//Collection x = jerseyMap.values();
		//Iterator itr = x.iterator();
		 */


		//final int size; 
		//size = jerseyMap.size();
		
		
		
		

	}
}


